package com.cn.appcore.config

import android.app.Application
import com.cn.appcore.utils.CustomActivityManager

/**
 * @author wxl
 * @date 2019/11/1
 * @desc 用来初始化项目所需要的配置
 */
object AppConfig {

    const val TAG = "KotlinMVVM"

    private var application: Application? = null
    private var  mActivityManager:  CustomActivityManager?=null



    /**
     * Init, it must be call before used .
     */
    fun init(application: Application) {
        AppConfig.application = application
        mActivityManager = CustomActivityManager()
    }

    fun getApplication(): Application {
        if (application == null) {
            throw RuntimeException("Please init in Application#onCreate first.")
        }
        return application!!
    }

    fun getActivityManager(): CustomActivityManager? {
        return mActivityManager
    }

}